package spring.code;

import org.springframework.context.ApplicationEvent;
import org.springframework.stereotype.Component;

/**
 * @Author DRevelation
 * @Date 2020-06-30 上午 9:22
 * @Desc 事件定义方式
 */
@Component
public class DemoEvent extends ApplicationEvent {

    private String message;
    /**
     * Create a new ApplicationEvent.
     *
     * @param source the object on which the event initially occurred (never {@code null})
     */
    public DemoEvent(Object source, String message) {
        super(source);
        this.message = message;
    }

    public String getMessage() {
        return message;
    }
}
